<template>
    <div class="listViewTop" :style="{}">
        <img class="bg" :src="playlist.coverImgUrl" alt="">
        <div class="listViewTopNav">
            <div class="letf">
                <svg class="icon" aria-hidden="true" @click="$router.go(-1)">
                    <use xlink:href="#icon-zuo1"></use>
                </svg>
                <div class="title">
                    歌单
                </div>
            </div>
            <div class="right">
                <svg class="icon sousuo" aria-hidden="true">
                    <use xlink:href="#icon-sousuo"></use>
                </svg>
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-fenxiang-"></use>
                </svg>
            </div>
        </div>
        <div class="content">
            <div class="content-left">
                <img :src="playlist.coverImgUrl">
                <span>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-bofang3"></use>
                    </svg>
                    {{changeValue(playlist.playCount)}}
                </span>
            </div>
            <div class="content-right">
                <h3>{{playlist.name}}</h3>
                <div class="author" >
                    <img :src="playlist.creator.avatarUrl" alt="">
                    <span>{{playlist.creator.nickname}} ></span>
                </div>
                <div class="description">
                    {{playlist.description}}
                </div>
            </div>
        </div>
        <div class="iconList">
            <div class="iconItem">
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-xiaoxi"></use>
                </svg>
                <span>{{playlist.commentCount}}</span>
            </div>
            <div class="iconItem">
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-fenxiang-"></use>
                </svg>
                <span>{{playlist.shareCount}}</span>
            </div>
            <div class="iconItem">
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-iconfontzhizuobiaozhun023146"></use>
                </svg>
                <span>下载</span>
            </div>
            <div class="iconItem">
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-duoxuankuang"></use>
                </svg>
                <span>多选</span>
            </div>
        </div>
    </div>
</template>
<style lang="less" scoped>
.listViewTop{
    width: 7.5rem;
    padding: 0 0.4rem;
    .bg{
        position: fixed;
        left: 0;
        top: 0;
        width: 7.5rem;
        height: auto;
        z-index: -1;
        filter: blur(20px);
    }
    .listViewTopNav{
        display: flex;
        justify-content: space-between;
        height: 1.2rem;
        align-items: center;
        font-size: 0.4rem;
        .letf,.right{
            display: flex;
            .icon{
                width: 0.5rem;
                height: 0.5rem;
                fill: white;
            }
            .title{
                margin-left:0.4rem ;
                color:white;
            }
            .sousuo{
                margin-right: 0.4rem;
            }
        }
    }
    .content{
        display: flex;
        justify-content: space-between;
        padding: 0.1rem 0;
        .content-left{
            position: relative;
            img{
                width: 2.8rem;
                height: 2.8rem;
                border-radius:0.1rem;
            }
            span{
                position:absolute;
                top: 0.1rem;
                right: 0.1rem;
                color: #ccc;
                display: flex;
                align-items: center;
                .icon{
                    fill: #ccc;
                }
            }
        }
        .content-right{
            width: 3.5rem;
            h3{
                color:white;
            }
            .author{
                color: #ccc;
                display: flex;
                align-items: center;
                margin: 0.2rem 0;
                img{
                    width: 0.6rem;
                    height: 0.6rem;
                    border-radius: 0.3rem;
                    margin-right: 0.2rem;
                }
            }
            .description{
                font-size: 0.24rem;
                color:#aaa;
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 2;
            }
        }
    }
    .iconList{
        display: flex;
        justify-content: space-around;
        .iconItem{
            display: flex;
            flex-direction: column;
            .icon{
                width: 0.6rem;
                height: 0.6rem;
                fill: white;
            }
            span{
                font-size: 0.3rem;
                color: #ccc;
                padding-top: 0.2rem ;
            }
        }
    }
}
</style>
<script>
import { getsize } from '@/utils/utils.js'
export default {
  props: ['playlist'],
  methods: {
    changeValue (num) {
      var res = getsize(num)
      return res
    }
  }
}
</script>
